<!DOCTYPE html>
<html lang="en">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/resource/common/layui/css/layui.css">
    <link rel="stylesheet" href="/resource/js/front/index.css">
</head>
<body>
<div th:replace="front/head :: heads"></div>
<div class="layui-container house-detail">
    <p class="title"><a href="index.html">首页</a> &gt; <span th:text="${chdClassName}"></span> &gt; <span>产品详情</span></p>
    <div class="layui-row price">
        <div class="layui-col-sm6">
            <div class="intro-img"><img th:src="${product.img}" style="width: 456px;height: 456px"></div>
        </div>
        <div class="layui-col-sm6 shopChoose">
            <div class="title"><p th:text="${product.name}">轻奢吊灯现代极简创意灯具</p>好评率 <span th:text="${good+'%'}"></span>
            </div>
            <p>
                <span>￥会员价
                    <big><b th:text="${product.price*product.discount}">199</b></big>
                </span>原价￥
                <big><b th:text="${product.price}">399</b></big>
            </p>
            <dl th:each="parameter:${product.parameters}">
                <dt th:text="${parameter}"></dt>
            </dl>
            <div class="number layui-form">
                <label>数量</label>
                <div class="layui-input-inline btn-input">
                    <button class="layui-btn layui-btn-primary sup">-</button>
                    <input type="text" id="number" class="layui-input">
                    <button class="layui-btn layui-btn-primary sub">+</button>
                </div>
                <label th:text="${' 库存'+product.inventoryData+'件'}"></label>
                <input hidden th:value="${product.inventoryData}" id="inventoryData">
                <p class="inputTips">已超出库存数量！</p>
            </div>
            <div class="shopBtn">
                <button class="layui-btn layui-btn-primary sale" th:id="${product.id}"
                        th:if="${product.inventoryData gt 1}">立即购买
                </button>
                <button class="layui-btn shop" th:id="${product.id}" th:if="${product.inventoryData gt 1}"><i
                        class="layui-icon layui-icon-house-shop"></i>加入购物车
                </button>
                <button th:id="${product.id}"
                        th:class="${product.collect==true}?'layui-btn layui-btn-primary collect':'layui-btn layui-btn-primary collect collectBtn'">
                    <i id="collect"
                       th:class="${product.collect==true}?'layui-icon layui-icon-rate-solid':'layui-icon layui-icon-rate'"></i><span
                        th:text="${product.collect==true}?'已收藏':'收藏'">收藏</span>
                </button>
            </div>
        </div>
    </div>
    <div class="layui-row layui-col-space30">
        <div class="layui-col-sm8 detailTab">
            <div class="layui-tab layui-tab-brief">
                <ul class="layui-tab-title">
                    <li class="layui-this">详情</li>
                    <li>评论 <span th:text="${'('+evaluateListNum+')'}"></span></li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <p th:utext="${product.particulars}"></p>
                    </div>
                    <div class="layui-tab-item">
                        <div class="comment">
                            <ul>
                                <!--<li th:each="evaluate:${evaluateList}">
                                    <div class="img">
                                        <img th:src="${evaluate.img}" style="border-radius: 50%">
                                        <span style="font-size: 10px;color: #3e94ed"
                                              th:text="${evaluate.userName}"></span>
                                    </div>
                                    <p class="txt"
                                       th:utext="${evaluate.content}"></p>
                                    <p style="top:40px;left: 63px">分</p>
                                    <p class="time" th:text="${#strings.substring(evaluate.time,0,19)}"></p>
                                </li>-->
                                <div class="layui-row" th:each="evaluate:${evaluateList}"
                                     style="margin-top: 20px;border-bottom: 1px solid #3e94ed;padding: 10px">
                                    <div class="layui-col-md2">
                                        <img th:src="${evaluate.img}"
                                             style="border-radius: 40%;width: 20px;height: 20px">
                                        <span style="font-size: 12px;color: #3e94ed"
                                              th:text="${evaluate.userName}"></span>
                                    </div>
                                    <div class="layui-col-md7">
                                        <p th:utext="${evaluate.content}" style="font-size: 12px;color: #555;"></p>
                                        <span th:text="${#strings.substring(evaluate.time,0,19)}"
                                              style="color: #ccc;font-size: 12px;"></span>
                                    </div>
                                    <div class="layui-col-md2" style="margin-left: 40px" th:if="${evaluate.score}=='5'">
                                        <span style="color: #3e94ed">评分:</span>
                                        <div style="margin-left: 40px">
                                            <i class="layui-icon layui-icon-praise"
                                               style="font-size: 20px; color: #3e94ed;margin-top: 10px"></i>
                                            <i class="layui-icon layui-icon-praise"
                                               style="font-size: 20px; color: #3e94ed;"></i>
                                            <i class="layui-icon layui-icon-praise"
                                               style="font-size: 20px; color: #3e94ed;"></i>
                                        </div>
                                    </div>
                                    <div class="layui-col-md2" style="margin-left: 40px" th:if="${evaluate.score}=='4'">
                                        <span style="color: #3e94ed">评分:</span>
                                        <div style="margin-left: 40px">
                                            <i class="layui-icon layui-icon-praise"
                                               style="font-size: 20px; color: #3e94ed;margin-top: 10px"></i>
                                            <i class="layui-icon layui-icon-praise"
                                               style="font-size: 20px; color: #3e94ed;margin-top: 10px"></i>
                                        </div>
                                    </div>
                                    <div class="layui-col-md2" style="margin-left: 40px" th:if="${evaluate.score}=='3'">
                                        <span style="color: #3e94ed">评分:</span>
                                        <div style="margin-left: 40px">
                                            <i class="layui-icon layui-icon-praise"
                                               style="font-size: 20px; color: #3e94ed;margin-top: 10px"></i>
                                        </div>
                                    </div>
                                    <div class="layui-col-md2" style="margin-left: 40px" th:if="${evaluate.score}=='2'">
                                        <span style="color: #3e94ed">评分:</span>
                                        <div style="margin-left: 40px">
                                            <i class="layui-icon layui-icon-tread"
                                               style="font-size: 20px; color: #3e94ed;margin-top: 10px"></i>
                                        </div>
                                    </div>
                                    <div class="layui-col-md2" style="margin-left: 40px" th:if="${evaluate.score}=='1'">
                                        <span style="color: #3e94ed">评分:</span>
                                        <div style="margin-left: 40px">
                                            <i class="layui-icon layui-icon-tread"
                                               style="font-size: 20px; color: #3e94ed;margin-top: 10px"></i>
                                            <i class="layui-icon layui-icon-tread"
                                               style="font-size: 20px; color: #3e94ed;"></i>
                                        </div>
                                    </div>
                                </div>
                            </ul>


                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- <div class="layui-col-sm4 detailCom">
             <p class="title">热销推荐</p>
             <ul class="detailCom-content hot-sell">
                 <li><a class="text">
                     <div><img src="../res/static/img/goods_img6.jpg"></div>
                     <p>森系小清新四件套</p>
                     <p class="price">￥200</p>
                 </a></li>
                 <li><a class="text">
                     <div><img src="../res/static/img/goods_img7.jpg"></div>
                     <p>森系小清新四件套</p>
                     <p class="price">￥200</p>
                 </a></li>
                 <li><a class="text">
                     <div><img src="../res/static/img/goods_img8.jpg"></div>
                     <p>森系小清新四件套</p>
                     <p class="price">￥200</p>
                 </a></li>
                 <li><a class="text">
                     <div><img src="../res/static/img/goods_img9.jpg"></div>
                     <p>森系小清新四件套</p>
                     <p class="price">￥200</p>
                 </a></li>
                 <li><a class="text">
                     <div><img src="../res/static/img/goods_img6.jpg"></div>
                     <p>森系小清新四件套</p>
                     <p class="price">￥200</p>
                 </a></li>
             </ul>
         </div>-->
    </div>
</div>
<!-- layui.js -->
<script type="text/javascript" src="/resource/common/layui/layui.js"></script>
<script type="text/javascript" src="/resource/js/front/house.js"></script>
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
    layui.use(['element', 'layer'], function () {
        var element = layui.element,
            layer = layui.layer,
            $ = layui.$;
        $('.sale').on('click', function () {
            //商品购买
            var productId = $(this).attr("id");
            var number = $('#number').val();
            location.href = '/front/subSale.do?productId=' + productId + '&number=' + number
        })
    });
</script>

</body>
</html>